<?php

namespace Nim\Bundle\ModelBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;

/**
 * Client
 *
 * @ORM\Table(name="client")
 * @ORM\Entity
 */
class Client
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="name", type="string", length=255)
     */
    private $name;
    
    /**
     * @ORM\ManyToMany(targetEntity="Reseller", mappedBy="clients")
     **/
    private $resellers;
    
    /**
     * @ORM\OneToMany(targetEntity="ClientOrder", mappedBy="client")
     */
    private $clientOrders;
    
    public function __construct()
    {
    	$this->resellers = new ArrayCollection();
    	$this->clientOrders = new ArrayCollection();
    }


    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set name
     *
     * @param string $name
     * @return Client
     */
    public function setName($name)
    {
        $this->name = $name;
    
        return $this;
    }

    /**
     * Get name
     *
     * @return string 
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Add resellers
     *
     * @param \Nim\Bundle\ModelBundle\Entity\Reseller $resellers
     * @return Client
     */
    public function addReseller(\Nim\Bundle\ModelBundle\Entity\Reseller $resellers)
    {
        $this->resellers[] = $resellers;
    
        return $this;
    }

    /**
     * Remove resellers
     *
     * @param \Nim\Bundle\ModelBundle\Entity\Reseller $resellers
     */
    public function removeReseller(\Nim\Bundle\ModelBundle\Entity\Reseller $resellers)
    {
        $this->resellers->removeElement($resellers);
    }

    /**
     * Get resellers
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getResellers()
    {
        return $this->resellers;
    }

    /**
     * Add clientOrders
     *
     * @param \Nim\Bundle\ModelBundle\Entity\ClientOrder $clientOrders
     * @return Client
     */
    public function addClientOrder(\Nim\Bundle\ModelBundle\Entity\ClientOrder $clientOrders)
    {
        $this->clientOrders[] = $clientOrders;
    
        return $this;
    }

    /**
     * Remove clientOrders
     *
     * @param \Nim\Bundle\ModelBundle\Entity\ClientOrder $clientOrders
     */
    public function removeClientOrder(\Nim\Bundle\ModelBundle\Entity\ClientOrder $clientOrders)
    {
        $this->clientOrders->removeElement($clientOrders);
    }

    /**
     * Get clientOrders
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getClientOrders()
    {
        return $this->clientOrders;
    }
}